package com.mcp.converter.domain.checker;

import com.mcp.converter.shared.enums.IncompatibilityType;
import com.mcp.converter.shared.response.sql.SQLElement;

/**
 * 不兼容点类
 * 表示SQL语句中的不兼容点
 */
public class IncompatiblePoint {

    /**
     * 不兼容点类型
     */
    private IncompatibilityType type;

    /**
     * 不兼容点名称
     */
    private String name;

    /**
     * 不兼容点值
     */
    private String value;

    /**
     * 不兼容点位置
     */
    private Position position;

    /**
     * 相关SQL元素
     */
    private SQLElement element;

    /**
     * 位置类
     */
    public static class Position {
        private int line;
        private int column;
        private int startIndex;
        private int endIndex;

        public Position(int line, int column, int startIndex, int endIndex) {
            this.line = line;
            this.column = column;
            this.startIndex = startIndex;
            this.endIndex = endIndex;
        }

        public int getLine() {
            return line;
        }

        public void setLine(int line) {
            this.line = line;
        }

        public int getColumn() {
            return column;
        }

        public void setColumn(int column) {
            this.column = column;
        }

        public int getStartIndex() {
            return startIndex;
        }

        public void setStartIndex(int startIndex) {
            this.startIndex = startIndex;
        }

        public int getEndIndex() {
            return endIndex;
        }

        public void setEndIndex(int endIndex) {
            this.endIndex = endIndex;
        }
    }

    public IncompatiblePoint() {
    }

    public IncompatiblePoint(IncompatibilityType type, String name) {
        this.type = type;
        this.name = name;
    }

    public IncompatiblePoint(IncompatibilityType type, String name, String value) {
        this(type, name);
        this.value = value;
    }

    // Getters and Setters

    public IncompatibilityType getType() {
        return type;
    }

    public void setType(IncompatibilityType type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public Position getPosition() {
        return position;
    }

    public void setPosition(Position position) {
        this.position = position;
    }

    public SQLElement getElement() {
        return element;
    }

    public void setElement(SQLElement element) {
        this.element = element;
    }
}
